<template>
  <div>
    <div class="adminIndex" v-if="activeModel == 'admin'">
      <adminHome />
    </div>
    <div class="appIndex" v-if="activeModel == 'app'">
      <appHome />
    </div>
  </div>
</template>
<script>
  import {mapGetters} from 'vuex'
  import adminHome from './dashboard/admin/adminDashboard'
  import appHome from './dashboard/app/appDashboard'
  import Cookies from 'js-cookie'
  export default {
    name: 'home',
    components: { adminHome, appHome, Cookies },
    data() {
      return {
        activeModel: 'app'
      };
    },
    created() {
      this.user.roles.forEach(item =>{
        if ('admin' == item){
          this.activeModel = 'admin'
        }
      })
    },
    computed: {
      ...mapGetters([
        'user'
      ])
    },
    methods: {

    }
  }
</script>
